Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CohereVectorizer for Embed 3 #410

Merged
merged 2 commits into from
Feb 21, 2024
Merged

Conversation

aidangomez
Copy link
Contributor

@aidangomez aidangomez commented Feb 19, 2024

Adds a new vectorizer for Cohere's Embed models analogous to OpenAIVectorizer. Details on the performance of the Embed 3 model can be found here

Of note, the Vectorizer interface doesn't specify whether a query versus a document is being embedded, but Cohere's embedding models produce different embeddings depending on the content you want to embed. The different options are in the docs, but taking this into account can product a fairly dramatic boost to performance.

@insop
Copy link
Contributor

insop commented Feb 19, 2024

LGTM

Copy link
Collaborator

@okhat okhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move import cohere inside the constructor to avoid creating a global dependency

@okhat
Copy link
Collaborator

okhat commented Feb 21, 2024

Hey @aidangomez , thanks so much for this PR! Looks great. I just moved import cohere inside the constructor to avoid breaking when it's not installed

@okhat okhat merged commit 44941a2 into stanfordnlp:main Feb 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants